package com.xzy.Controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;
@RestController
public class Payment_Consumer {
    private static final String REST_URL="http://PAYMENT-PROVIDER";
    @Autowired
    private RestTemplate restTemplate;

    @GetMapping("/consumer/get/{id}")
    public String get(@PathVariable("id")Long id){
        return restTemplate.getForObject(REST_URL+"/get/"+id,String.class);
    }
}
